
<script>
	function check(){
	alert("check");
		var name = document.getElementById("name");
		var password = document.getElementById("password");
		var password1 = document.getElementById("password1");
		
		if(name==null || ""==name){
			alert("用户名为空");
			return false;
		}
		
		if(password==null || password.length < 6 || password.length > 20){
			alert("密码不能为空，且长度大于等于6位,小于20位");
		}
		
		if(password1==null || password1.length!=password.length){
			alert("两次密码不相同");return false;
		}
		
		return true;
	}
</script>

<form action="/admin/user/insert" method="post" onSubmit="return check();">
<tabel width="500">
	<tr><td>用户名</td><td><input type="text" name="name" id="name"/> </td></tr>
	<tr><td>密码</td><td><input type="password" name="password" id="password" /> </td></tr>
	<tr><td>确认密码</td><td><input type="password" name="password1" id="password1" /> </td></tr>
</table>

<input type="submit" value="提交" />
</form>